package edu.sctu.xialei.june.day20150610one.modle;


import java.util.HashMap;

/**
* Created by Administrator on 6/10/2015.
*/

//售票机类
public class TicketMachine {

    public SubwayCard salesCard(String startTrainStop,String endTrainStop){

        HashMap<String, Integer> map = new HashMap<String, Integer>();
        map.put("犀浦", 1);
        map.put("茶店子", 2);
        map.put("一品天下", 3);
        map.put("蜀汉路", 4);
        map.put("天府广场", 5);
        map.put("东大路", 6);
        map.put("成渝立交", 7);
        map.put("惠王陵", 8);
        map.put("成都行政学院", 9);
        map.put("书房", 10);
        map.put("龙泉", 11);

        float price = 3;

        float money = ( map.get(startTrainStop) - map.get(endTrainStop) )*price;

        SubwayCard subwayCard = new SubwayCard();

        subwayCard.balance = money;
        subwayCard.vip = false;

        return subwayCard;
    }
}
